package dataStructure.xmg1.a07;

import dataStructure.xmg1.a07.printer.BinaryTrees;
import dataStructure.xmg1.a07.tree.AVLTree;

import java.util.ArrayList;
import java.util.List;

/**
 * @author: vince_zww
 * @date: 2020/12/13 23:04
 * @desceription:
 */
public class Main {

    static void test2() {
        Integer data[] = new Integer[]{
                7, 4
                , 9, 2, 5, 8, 11, 3, 12, 1, 10,18,22,99
        };

        AVLTree<Integer> avl = new AVLTree<>();
        for (int i = 0; i < data.length; i++) {
            avl.add(data[i]);
            BinaryTrees.println(avl);
        }
        avl.remove(99);
        avl.remove(22);
        avl.remove(12);
        avl.remove(18);
        BinaryTrees.println(avl);

    }

    static void test1() {
        Integer data[] = new Integer[]{
                7, 4
                , 9, 2, 5, 8, 11, 3, 12, 1, 10,18,22,99
        };

        AVLTree<Integer> avl = new AVLTree<>();
        for (int i = 0; i < data.length; i++) {
            avl.add(data[i]);
            System.out.println("【"+data[i]+"】");
            BinaryTrees.println(avl);
            System.out.println("-----------------------------------");
        }
        BinaryTrees.println(avl);

    }

    public static void main(String[] args) {
        test2();

//        List<Integer> data = new ArrayList<>();
    }
}
